import request from '@/utils/request'
import { getMiniAppId } from '@/utils/index'

// 列表
export function miniAppList(data) {
  if (data) {
    !data.key_word ? (data.key_word = '') : ''
  } else {
    data = {
      key_word: ''
    }
  }
  return request({
    url: '/admin/mini_app/appDropdown',
    method: 'post',
    data: data
  })
}
// 公共接口 channel渠道，memberId用户ID，miniApp小程序，merchant商户号，playlet短剧，chapter剧集，playletStatus短剧展示位置
export function commonData(data) {
  return request({
    url: '/admin/searchcondition/search',
    method: 'post',
    data: data
  })
}

// upload
export function uploadOssInfo(data) {
  return request({
    url: '/admin/common/ossInfo',
    method: 'post',
    data: data
  })
}
// upload
export function uploadgetOssSts(data) {
  return request({
    url: '/admin/common/getOssSts',
    method: 'post',
    data: data
  })
}

// 操作日志

export function getSystemModelLog(data) {
  return request({
    url: '/admin/systemlog/list',
    method: 'post',
    data: data
  })
}

// 修复
export function chapterDuration(data) {
  return request({
    url: 'admin/sys_playlet/chapterDuration',
    method: 'post',
    data: data
  })
}

// 小程序类型列表
export function uploadFile(data) {
  return request({
    url: '/admin/problem_answer/uploadFile',
    method: 'post',
    data: data
  })
}
// 小程序类型列表
export function appTypeDropdown(data) {
  return request({
    url: '/admin/mini_app/appTypeDropdown',
    method: 'post',
    data: data
  })
}

// 获取栏位配置
export function getranklist(data) {
  return request({
    url: '/admin/mini_app_rank/list',
    method: 'post',
    data: getMiniAppId(data)
  })
}

// 获取栏位配置图片
export function getrankicon(data) {
  return request({
    url: '/admin/mini_app_rank/icon',
    method: 'post',
    data: data
  })
}
